; position domain:
; Csaba Toth

(define (domain position)
	(:requirements :strips :typing :adl :preferences)
	
	(:types
		t_burglar t_dog t_guard		- t_agent
		t_key t_ladder t_treasure	- t_item
		t_agent t_container			- t_inventory
		t_door t_floor				- t_stepable
		t_container t_door			- t_lockable
		t_phone t_vender			- t_operable
		t_camera t_container t_stepable t_phone t_switch t_vender - t_position
	)
	
	(:predicates	
		(connected ?pos1 - t_position ?pos2 - t_position)
			; pos2 is directly reachable from pos1
		(agent_at_position ?agent - t_agent ?position - t_stepable)
		(position_active ?position - t_venter)
	)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; actions:
;;
;;;; move_floor			- moves the selected agent from one stepable position 
;;;;						(door has been removed) to another if there is
;;;;						a connection between them with the right direction
;;;; use_vender			- 
;;;; use_telephone		- 
;;;; use_switch			- 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(:action move_floor
		:parameters
		(
			?agent		- t_agent 
			?old_pos	- t_stepable
			?new_pos	- t_floor
		)
		:precondition
		(and
			(agent_at_position ?agent ?old_pos)
			(connected ?old_pos ?new_pos)
		)
		:effect
		(and
			(agent_at_position ?agent ?new_pos)
			(not (agent_at_position ?agent ?old_pos))
		)
	)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	(:action use_vender
		:parameters
		(
			?agent			- t_agent 
			?standing_pos	- t_stepable
			?target_pos		- t_vender
		)
		:precondition
		(and
			(agent_at_position ?agent ?standing_pos)
			(connected ?target_pos ?new_pos)
		)
		:effect
		(and
			(not (agent_at_position ?agent ?old_pos))
		)
	)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
)


